<?php
namespace app\home\controller;
use think\Db;
use app\home\model\Crawler as CrawlerModel;
class Crawler
{
     /**
     * @author jerry xiao
     * @param array $data 返回json
     * @datetime  2018/3/2
     * http://api.com/index.php/home/Crawler/index
     */
    public function index(){
        $list=CrawlerModel::getlist();
        foreach($list as $key =>$val){
            if($val['picture']){
                $data[]=[
                    'creator'       =>'jerry',
                    'createdate'    =>date('Y-m-d H:i:s'),
                    'novel_name'    =>'剑来',
                    'chapter_name'  =>$val['picture'],
                    'original_url'  =>$val['url'],
                    'message'       =>'',
                    'type'          =>'1'
                ];
            }

        }
		dump($data);
        // $res=Db::table('cms_article')->insertAll($data);
    }

         /**
     * @author jerry xiao
     * @param array $data 返回json
     * @datetime  2018/3/2
     * http://api.com/index.php/home/Crawler/articledetail
     */
    public function articledetail(){
        $list=CrawlerModel::articledetail();

    }
}
